class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int num = 0;
        int sz = nums.size();
        for (int i = 0; i < sz; i++)
        {
            num ^= nums[i];
        }
        return num;
    }
};